package com.beiben.workflow.mapper;

import com.beiben.workflow.domain.WfApply;
import com.beiben.workflow.domain.WfApplyVo;
import com.beiben.workflow.domain.WfCheck;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 工作流申请Mapper接口
 *
 * @author 熊国强
 * @date 2020-12-17
 */
public interface WfApplyMapper {
    /**
     * 查询工作流申请
     *
     * @param applyId 工作流申请ID
     * @return 工作流申请
     */
    public WfApply selectWfApplyById(Long applyId);

    /**
     * 查询工作流申请
     *
     * @param checkId 审核ID
     * @return 工作流申请
     */
    public WfApply selectWfApplyByCheckId(@Param("checkId") Long checkId);

    /**
     * 查询工作流申请列表
     *
     * @param wfApply 工作流申请
     * @return 工作流申请集合
     */
    public List<WfApply> selectWfApplyList(WfApply wfApply);

    /**
     * 新增工作流申请
     *
     * @param wfApply 工作流申请
     * @return 结果
     */
    public int insertWfApply(WfApply wfApply);

    /**
     * 修改工作流申请
     *
     * @param wfApply 工作流申请
     * @return 结果
     */
    public int updateWfApply(WfApply wfApply);

    /**
     * 删除工作流申请
     *
     * @param applyId 工作流申请ID
     * @return 结果
     */
    public int deleteWfApplyById(Long applyId);

    /**
     * 批量删除工作流申请
     *
     * @param applyIds 需要删除的数据ID
     * @return 结果
     */
    public int deleteWfApplyByIds(Long[] applyIds);

    @Options(useGeneratedKeys = true)
    public Long insertWfApplyRtId(WfApplyVo wfApply);


    /**
     * 提交审批
     *
     * @param apply
     * @return
     */
    int submitApply(WfApply apply);

    /**
     * 查询我的申请列表
     *
     * @param wfApply
     * @return
     */
    List<WfApplyVo> selecApplyList(WfApplyVo wfApply);

    /**
     * 验证申请是否提交
     *
     * @param tableId
     * @param tableName
     * @return
     */
    WfApplyVo verifyApplyInfoByIdAndName(@Param("tableId") Long tableId, @Param("tableName") String tableName);
}
